﻿using System;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using InterLinq.Types;

namespace InterLinq {
	/// <summary>
	/// Base Class for InterLinq Queries.
	/// </summary>
	[Serializable]
	[DataContract]
	public abstract class InterLinqQueryBase {
		#region Properties

		#region Property ElementType

		/// <summary>
		/// See <see cref="Type">Element Type</see> of the <see cref="Expression"/>.
		/// </summary>
		[NonSerialized]
		protected Type m_elementType;

		/// <summary>
		/// Gets or sets a <see cref="Type">Element Type</see> of the <see cref="Expression"/>.
		/// </summary>
		public abstract Type ElementType { get; }

		#endregion

		#region Property InterLinqElementType

		/// <summary>
		/// See <see cref="InterLinqType">InterLINQ Element Type</see> of the <see cref="Expression"/>.
		/// </summary>
		protected InterLinqType m_elementInterLinqType;

		/// <summary>
		/// Gets or sets a <see cref="InterLinqType">InterLINQ Element Type</see> of the <see cref="Expression"/>.
		/// </summary>
		[DataMember]
		public InterLinqType ElementInterLinqType {
			get { return m_elementInterLinqType; }
			set { m_elementInterLinqType = value; }
		}

		#endregion

		#endregion
	}
}